<?php
$menu = $tc->menu(0,6);
$i = 0;
while($row_menu = mysql_fetch_array($menu)){
	$i++;
	if($i==1) $view_menu1 	  = '<a href="'.$row_menu['url'].'" title="'.$row_menu['title'].'">'.$row_menu['name'].'</a>';
	elseif($i==2) $view_menu2 = '<a href="'.$row_menu['url'].'" title="'.$row_menu['title'].'">'.$row_menu['name'].'</a>';
	elseif($i==3) $view_menu3 = '<a href="'.$row_menu['url'].'" title="'.$row_menu['title'].'">'.$row_menu['name'].'</a>';
	elseif($i==4) $view_menu4 = '<a href="'.$row_menu['url'].'" title="'.$row_menu['title'].'">'.$row_menu['name'].'</a>';
	elseif($i==5) $view_menu5 = '<a href="'.$row_menu['url'].'" title="'.$row_menu['title'].'">'.$row_menu['name'].'</a>';
}

$menu = $tc->menu(0,2);
while($row_menu = mysql_fetch_array($menu)){
	$view_foo .= '<a href="'.$row_menu['url'].'" title="'.$row_menu['title'].'">'.$row_menu['name'].'</a>';
}

$view_post = '
<div id="homepage">
	<div id="logopage" style="background:url('.url_catalog_image.'logo-new.png) no-repeat"><h1>“Make your Life better”</h1></div>
	<div id="thanhcong" style="background:url('.url_catalog_image.'thanh-cong.png) no-repeat">'.$view_menu1.'</div>
	<div id="sanpham" style="background:url('.url_catalog_image.'san-pham.png) no-repeat">'.$view_menu2.'</div>
	<div id="lichlamviec" style="background:url('.url_catalog_image.'lich-lam-viec.png) no-repeat">'.$view_menu3.'</div>
	<div id="tuvan" style="background:url('.url_catalog_image.'tu-van.png) no-repeat">'.$view_menu4.'</div>
	<div id="lienhe" style="background:url('.url_catalog_image.'lien-he.png) no-repeat">'.$view_menu5.'</div>
	<div id="language" style="background:url('.url_catalog_image.'lang.png) no-repeat">
		<a href="http://www.totalife.com.tw/tw/news.htm" target="_blank">台灣</a>
		<a href="http://www.totalifeusa.com/eng/company.htm" target="_blank">USA /中國</a>
		<a href="http://www.totalife.com.my/" target="_blank">Malaysia</a>
		<a href="http://www.totalife.com.my/view.php?page=Contact%20Us%20-%20Singapore" target="_blank">Singapore</a>
	</div>
    <div id="menuhome">
    	<div style="clear:both; margin-bottom:10px">'.$view_foo.'</div>
        <div style="clear:both; margin-bottom:30px; color:#FFF">Bản quyền của Total Life Vietnam 2013.</div>
    </div>
</div>
<div id="popupContact" style="width:520px">
	<div id="popupContactClose"><img src="images/popupClose.png" align="popup Close" /></div>
	<div id="popupContent" style="width:400px; margin:0; padding:18px 0 0 0; background:none"><img src="images/tong-cty-va-chi-nhanh.jpg" alt="tổng công ty và chi nhành" /></div>
</div>
<div id="backgroundPopup"></div>

<script type="text/javascript">
$(document).ready(function() {
    $("#logopage").click(function(){
		centerPopup2();
		loadPopup();
		$(window).bind("resize", function(){ centerPopup2("absolute"); });
		$("#popupContactClose").live("click",function(){ disablePopup();});
		$(document).keypress(function(e){if(e.keyCode==27 || popupStatus==1) disablePopup();});
	});
});
</script>

<script type="text/javascript">
$(document).ready(function(){
	$("#menuhome a:first").css("border","none");
});
</script>';